
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="org.swim.web.utils.*"
	import="org.swim.remote.entities.*"%>
<%@page import="org.apache.commons.lang.WordUtils"%>
<%@page import="java.util.ArrayList"%>
<%@page import="org.swim.web.servlet.consts.*"%>
<%@page import="java.util.List"%>

<!DOCTYPE html>
<html lang="en">
<head>
<%@include file="include/header.jsp"%>
<style type="text/css">

/* 	Collaboration */
.profile {
	padding: 15px;
	padding-top: 10px;
	margin: 15px;
}

.profile .alert {
	padding-right: 14px;
}

.profile:HOVER {
	background: #EEE;
}

.profile p {
	line-height: normal;
}

.btn.disabled {
	opacity: 1;
}
</style>

<%
	IUser user = (IUser) request.getAttribute("user");
	List<IAbility> abilities = new ArrayList<IAbility>(
			user.getAbilitiesSet());
%>

<title><%=SwimConst.getTitle("Profile")%></title>
</head>
<body>
	<%@include file="include/navbar.jsp"%>
	<%@include file="include/error-handling.jsp"%>
	<%@include file="include/new-collaboration.jsp"%>
	
	<div class="container">
		<div class="row">
			<div class="span8 ui-corner-all" style="background: #DDD">
				<div class="row">
					<div class="span8">
						<div class="row profile medium-text ui-corner-all">
							<h4><%=SwimUtils.capitalizaName(user.getFullName().toLowerCase())%></h4>
							<div class="alert alert-info pull-right">
								Feedback:
								<%=user.getFeedbackAvgVal()%></div>
							<div class="span2" style="display: block">
								<img src="<%=SwimConst.Url.WEBCONTENT%>/img/default/user256.png"
									width="126" class="img-polaroid" style="background: #FFF">
							</div>
							<div class="span8" style="margin-top: 15px;">
								<%@include file="include/userbar.jsp"%>
							</div>

						</div>
					</div>
					<div class="span8">
						<div class="row profile medium-text ui-corner-all">
							<h4>Abilities</h4>
							<div>
								<form class="navbar-form">
									<div>
										<%
											IAbility ability;
											String name;
											String cssClass = "";
											for (int i = 0; i < abilities.size(); i++) {
												ability = abilities.get(i);
												name = SwimUtils.capitalizeFirstChar(ability.getName()
														.toLowerCase());
												if (ability.getStatus() == IAbility.Status.CONFIRMED) {
													cssClass = "btn-success";
										%>

										<input name="abilities" type="hidden"
											value="<%=SwimUtils.capitalizeFirstChar(ability.getName()
							.toLowerCase())%>">
										<a class="btn <%=cssClass%> disabled" style="margin-top: 5px"><%=name%></a>
										<%
											}
											}
										%>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
			<%@include file="include/notifications.jsp"%>
		</div>
	</div>
	<%@include file="include/footer.jsp"%>
	<%@include file="include/script-common.jsp"%>
	<script type="text/javascript"
		src="<%=SwimConst.Url.WEBCONTENT%>/js/myprofile.js"></script>
</body>
</html>